{* splash page *}
<include href="templates/layout/splash.html"/>

{* counter for DB warnings (all databases) *}
{{ @tplCounter('reset', 'database_warning_all') }}
<section>
    <div class="container">

        <div class="row"></div>

        <div class="row text-center">
            <div class="col-md-6 col-md-offset-3">
                <h2><span class="text-primary">Setup</span> and Bootstrapping</h2>
                <p class="lead">
                    The following steps will guide you through the database bootstrapping/update process for <em>PATHFINDER</em>.
                </p>
            </div>
        </div>

        {* Errors *}
        <check if="{{ @errorData }}">
            <div class="alert alert-danger">
                <button type="button" class="close" data-dismiss="alert" aria-label="Close"><i class="fas fa-times"></i></button>
                <span class="txt-color txt-color-danger">({{ @errorData->code }}) {{ @errorData->status }}</span>
                <small> {{ @errorData->text }}</small>
            </div>
        </check>
    </div>
</section>

<section id="pf-setup-server">
    <div class="container row--reverse">
        <div class="row text-center pf-setup-body-server collapse in">

            <div class="col-xs-12 col-md-6 pf-landing-pricing-panel">

                {* Information *}
                <div class="panel panel-default pricing-big">

                    <div class="panel-heading text-left">
                        <h3 class="panel-title">Information</h3>
                    </div>
                    <div class="panel-body no-padding text-align-center">

                        <table class="table">
                            <thead>
                            <tr>
                                <td>Installation</td>
                                <td class="text-right col-md-8">{{ @PATHFINDER.NAME }}</td>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td>Version</td>
                                <td class="text-right">
                                    <kbd>{{ @PATHFINDER.VERSION }}</kbd>
                                </td>
                            </tr>
                            <tr>
                                <td>Package</td>
                                <td class="text-right">
                                    <kbd>{{ @PACKAGE }} {{ @VERSION }}</kbd>
                                </td>
                            </tr>
                            <tr>
                                <td>Contact</td>
                                <td class="text-right"><a href="{{ @PATHFINDER.CONTACT }}" target="_blank" rel="noopener">{{ @PATHFINDER.CONTACT }}</a></td>
                            </tr>
                            <tr>
                                <td>Repository</td>
                                <td class="text-right"><a href="{{ @PATHFINDER.REPO }}" target="_blank" rel="noopener">{{ @PATHFINDER.REPO }}</a></td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>

                {* Directories *}
                <div class="panel panel-default pricing-big">

                    <div class="panel-heading text-left">
                        <h3 class="panel-title">Directories</h3>
                    </div>
                    <div class="panel-body no-padding text-align-center">

                        <table class="table">
                            <thead>
                            <tr>
                                <td></td>
                                <td class="text-right col-md-4">config.ini</td>
                                <td class="text-right col-md-1" title="permission from chmod()"><i class="fas fa-fw fa-key"></i></td>
                            </tr>
                            </thead>
                            <tbody>
                            <repeat group="{{ @directoryConfig }}" value="{{ @directoryData }}">
                                <tr>
                                    <td>{{@directoryData.label}}
                                        <check if="{{ @directoryData.tooltip }}">
                                            <i class="fas fa-fw fa-sm fa-question-circle pf-help-light" title="{{ @directoryData.tooltip }}"></i>
                                        </check>
                                    </td>
                                    <td class="text-right">
                                        <check if="{{ @directoryData.check }}">
                                            <true>
                                                <kbd>{{@directoryData.value | raw}}</kbd>
                                            </true>
                                            <false>
                                                <kbd class="txt-color txt-color-danger">{{@directoryData.value | raw}}</kbd>
                                            </false>
                                        </check>
                                    </td>
                                    <td class="text-right">{{@directoryData.chmod}}</td>
                                </tr>
                            </repeat>
                            </tbody>
                        </table>

                    </div>
                </div>

            </div>

            <div class="col-xs-12 col-md-6 pf-landing-pricing-panel">
                {* Server *}
                <div class="panel panel-default pricing-big">
                    <div class="panel-heading text-left">
                        <h3 class="panel-title">Server</h3>
                    </div>
                    <div class="panel-body no-padding text-align-center">

                        <table class="table">
                            <thead>
                            <repeat group="{{ @serverInformation }}" value="{{ @information }}">
                                <tr>
                                    <td>{{@information.label}}</td>
                                    <td class="text-right col-md-8">{{@information.value}}</td>
                                </tr>
                            </repeat>

                            </thead>
                        </table>

                    </div>
                </div>

                {* System Env requirements *}
                <check if="{{ @checkSystemConfig }}">
                    <set requirementsData="{{ @checkSystemConfig }}" />

                    <div class="panel panel-default pricing-big">
                        <div class="panel-heading text-left">
                            <h3 class="panel-title">Environment variables [optional]</h3>
                        </div>
                        <div class="panel-body no-padding text-align-center">
                            <include href="templates/modules/requirements_table.html"/>
                        </div>
                        <div class="panel-footer text-align-center">
                            <check if="{{ !@tplCounter('get') }}">
                                <true>
                                    <h3 class="panel-title txt-color txt-color-success">OK</h3>
                                </true>
                                <false>
                                    <h3 class="panel-title txt-color txt-color-warning">{{ @tplCounter('get') }} warning</h3>
                                </false>
                            </check>
                        </div>
                    </div>
                    {{ @tplCounter('add', 'server_warning', @tplCounter('get')) }}
                    {{ @tplCounter('reset') }}
                </check>
            </div>

        </div>

        <h4 data-target=".pf-setup-body-server" data-toggle="collapse"><i class="fas fa-fw fa-network-wired"></i> Server
            <div class="pull-right">
                <span class="badge badge-warning" title="warning" data-placement="top">{{ @tplCounter('get', 'server' . '_warning') }}</span>
                <span class="badge badge-danger" title="error" data-placement="top">{{ @tplCounter('get', 'server' . '_danger') }}</span>
            </div>
        </h4>
    </div>
</section>

<section id="pf-setup-environment">
    <div class="container row--reverse">
        <div class="row text-center pf-setup-body-environment collapse in">
            <div class="col-xs-12 col-md-6 pf-landing-pricing-panel">
                {* Framework requirements (PHP) *}
                <set requirementsData="{{@checkRequirements}}" />

                <div class="panel panel-default pricing-big">
                    <div class="panel-heading text-left">
                        <h3 class="panel-title">Requirements</h3>
                    </div>
                    <div class="panel-body no-padding text-align-center">
                        <include href="templates/modules/requirements_table.html"/>
                    </div>
                    <div class="panel-footer text-align-center">
                        <check if="{{ !@tplCounter('get') }}">
                            <true>
                                <h3 class="panel-title txt-color txt-color-success">OK</h3>
                            </true>
                            <false>
                                <h3 class="panel-title txt-color txt-color-warning">{{ @tplCounter('get') }} warning</h3>
                            </false>
                        </check>
                    </div>
                </div>
                {{ @tplCounter('add', 'environment_warning', @tplCounter('get')) }}
                {{ @tplCounter('reset') }}
            </div>

            <div class="col-xs-12 col-md-6 pf-landing-pricing-panel">
                {* PHP config php.ini requirements *}
                <set requirementsData="{{ @checkPHPConfig }}" />

                <div class="panel panel-default pricing-big">
                    <div class="panel-heading text-left">
                        <h3 class="panel-title">PHP config <kbd class="pull-right">php.ini</kbd></h3>
                    </div>
                    <div class="panel-body no-padding text-align-center">
                        <include href="templates/modules/requirements_table.html"/>
                    </div>
                    <div class="panel-footer text-align-center">
                        <check if="{{ !@tplCounter('get') }}">
                            <true>
                                <h3 class="panel-title txt-color txt-color-success">OK</h3>
                            </true>
                            <false>
                                <h3 class="panel-title txt-color txt-color-warning">{{ @tplCounter('get') }} warning</h3>
                            </false>
                        </check>
                    </div>
                </div>
                {{ @tplCounter('add', 'environment_warning', @tplCounter('get')) }}
                {{ @tplCounter('reset') }}
            </div>
        </div>

        <h4 data-target=".pf-setup-body-environment" data-toggle="collapse"><i class="fas fa-fw fa-server"></i> Environment
            <div class="pull-right">
                <span class="badge badge-warning" title="warning" data-placement="top">{{ @tplCounter('get', 'environment' . '_warning') }}</span>
                <span class="badge badge-danger" title="error" data-placement="top">{{ @tplCounter('get', 'environment' . '_danger') }}</span>
            </div>
        </h4>
    </div>
</section>

<section id="pf-setup-settings">
    <div class="container row--reverse">
        <div class="row text-center pf-setup-body-settings collapse in">
            <div class="col-xs-12 col-md-6 pf-landing-pricing-panel">
                <div class="panel panel-default pricing-big">

                    <div class="panel-heading text-left">
                        <h3 class="panel-title">Configuration</h3>
                    </div>

                    <div class="panel-body no-padding text-align-center">
                        <table class="table">
                            <thead>
                            <repeat group="{{ @environmentInformation }}" value="{{ @environmentData }}">
                                <tr>
                                    <td>{{@environmentData.label}}</td>
                                    <td class="text-right col-md-8">
                                        <check if="{{ @environmentData.check }}">
                                            <true>
                                                <kbd>{{@environmentData.value | raw}}</kbd>
                                            </true>
                                            <false>
                                                <kbd class="txt-color txt-color-danger">{{@environmentData.value | raw}}</kbd>
                                            </false>
                                        </check>
                                    </td>
                                </tr>
                            </repeat>
                            </thead>
                        </table>
                    </div>

                </div>
            </div>

            <div class="col-xs-12 col-md-6 pf-landing-pricing-panel">

                {* Pathfinder Modules *}
                <div class="panel panel-default pricing-big">

                    <div class="panel-heading text-left">
                        <h3 class="panel-title">Modules</h3>
                    </div>

                    <div class="panel-body no-padding text-align-center">
                        <table class="table">
                            <thead>
                            <tr>
                                <td><i class="fas fa-fw fa-sign-in-alt"></i> Registration/Login</td>
                                <td class="text-right col-md-2">
                                    <check if="{{ @PATHFINDER.REGISTRATION.STATUS }}">
                                        <true>
                                            <kbd class="txt-color txt-color-success">enabled</kbd>
                                        </true>
                                        <false>
                                            <kbd class="txt-color txt-color-warning">disabled</kbd>
                                        </false>
                                    </check>
                                </td>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td><i class="fab fa-fw fa-slack-hash"></i> Slack</td>
                                <td class="text-right col-md-2">
                                    <check if="{{ @PATHFINDER.SLACK.STATUS }}">
                                        <true>
                                            <kbd class="txt-color txt-color-success">enabled</kbd>
                                        </true>
                                        <false>
                                            <kbd class="txt-color txt-color-warning">disabled</kbd>
                                        </false>
                                    </check>
                                </td>
                            </tr>
                            <tr>
                                <td><i class="fab fa-fw fa-discord"></i> Discord</td>
                                <td class="text-right col-md-2">
                                    <check if="{{ @PATHFINDER.DISCORD.STATUS }}">
                                        <true>
                                            <kbd class="txt-color txt-color-success">enabled</kbd>
                                        </true>
                                        <false>
                                            <kbd class="txt-color txt-color-warning">disabled</kbd>
                                        </false>
                                    </check>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>

                </div>

                {* Map Settings *}
                <div class="panel panel-default pricing-big">

                    <div class="panel-heading text-left">
                        <h3 class="panel-title">Map Settings</h3>
                    </div>

                    <div class="panel-body no-padding text-align-center">

                        <table class="table">
                            <thead>
                            <tr>
                                <td class="col-sm-6"></td>
                                <repeat group="{{ @mapsDefaultConfig.mapTypes }}" value="{{ @mapType }}">
                                    <td class="text-right col-sm-2">{{ @mapType }}</td>
                                </repeat>
                            </tr>
                            </thead>
                            <tbody>
                                <repeat group="{{ @mapsDefaultConfig.mapConfig }}" key="{{ @mapConfValue }}" value="{{ @mapConf }}">
                                    <tr>
                                        <td>{{ @mapConf.label | raw }}
                                            <check if="{{ @mapConf.tooltip }}">
                                                <i class="fas fa-fw fa-sm fa-question-circle pf-help-light" title="{{ @mapConf.tooltip }}"></i>
                                            </check>
                                        </td>
                                        <repeat group="{{ @mapConf.data }}" value="{{ @mapTypeConfValue }}">
                                            <td class="text-right">
                                                <switch expr="{{ @mapTypeConfValue }}">
                                                    <case value="1" break="true">
                                                        <kbd class="txt-color txt-color-success">enabled</kbd>
                                                    </case>
                                                    <case value="0" break="true">
                                                        <kbd>disabled</kbd>
                                                    </case>
                                                    <default>
                                                        <kbd>{{ @mapTypeConfValue }}</kbd>
                                                    </default>
                                                </switch>
                                            </td>
                                        </repeat>
                                    </tr>
                                </repeat>
                            </tbody>
                        </table>

                    </div>
                </div>
            </div>

        </div>

        <h4 data-target=".pf-setup-body-settings" data-toggle="collapse"><i class="fas fa-fw fa-sliders-h"></i> Settings
            <div class="pull-right">
                <span class="badge badge-warning" title="warning" data-placement="top">{{ @tplCounter('get', 'settings' . '_warning') }}</span>
                <span class="badge badge-danger" title="error" data-placement="top">{{ @tplCounter('get', 'settings' . '_danger') }}</span>
            </div>
        </h4>
    </div>
</section>

<section id="pf-setup-database">
    <div class="container row--reverse">
        <div class="row text-center pf-setup-body-database collapse in">

            <repeat group="{{ @checkDatabase }}" key="{{ @dbKey }}" value="{{ @dbInformation }}">
                {* Check if DB is connected and up2date *}
                <set dbConnectionStatus="OK" />
                <set dbStatusCheck="OK" />

                <check if="{{ @dbInformation.info.dbCreate }}">
                    <true>
                        <set dbConnectionStatus="Database not found" />
                        {{ @tplCounter('increment', 'database_danger') }}
                        {{ @tplCounter('increment', 'database_warning_all') }}
                    </true>
                    <false>
                        <check if="{{ !@dbInformation.info.connected }}">
                            <set dbConnectionStatus="Connection failed" />
                            {{ @tplCounter('increment', 'database_danger') }}
                            {{ @tplCounter('increment', 'database_warning_all') }}
                        </check>
                    </false>
                </check>


                <div class="col-xs-12 col-md-6 pf-landing-pricing-panel">
                    <div class="panel panel-default pricing-big">

                        <div class="panel-heading text-left">
                            <h3 class="panel-title">{{ @dbInformation.info.label }}</h3>
                        </div>
                        <div class="panel-body no-padding text-align-center">

                            <table class="table">
                                <thead>
                                <tr>
                                    <td>DB driver</td>
                                    <td class="text-right col-sm-6 col-md-3" colspan="2">{{ @dbInformation.info.driver }}</td>
                                    <td class="text-right col-sm-1 col-md-1"></td>
                                </tr>
                                </thead>
                                <tbody>
                                <tr>
                                    <td>DB host:port</td>
                                    <td class="text-right col-sm-3 col-md-3" colspan="2"><kbd>{{ @dbInformation.info.host }}:{{ @dbInformation.info.port }}</kbd></td>
                                    <td class="text-right col-sm-1 col-md-1"></td>
                                </tr>
                                <tr>
                                    <td>DB name</td>
                                    <td class="text-right col-sm-3 col-md-3" colspan="2">
                                        <kbd class="txt-color {{ (@dbInformation.info.connected) ?'txt-color-success':'txt-color-danger' }}">{{ @dbInformation.info.name }}</kbd>
                                    </td>
                                    <td class="text-right col-sm-1 col-md-1">
                                        <check if="{{ @dbInformation.info.connected }}">
                                            <true>
                                                <i class="fas fa-fw fa-check txt-color txt-color-success"></i>
                                            </true>
                                            <false>
                                                <i class="fas fa-fw fa-exclamation-triangle txt-color txt-color-danger"></i>
                                            </false>
                                        </check>
                                    </td>
                                </tr>
                                <tr>
                                    <td>DB user</td>
                                    <td class="text-right col-sm-3 col-md-3" colspan="2"><kbd>{{ @dbInformation.info.user }}</kbd></td>
                                    <td class="text-right col-sm-1 col-md-1"></td>
                                </tr>
                                <tr>
                                    <td>DB pass</td>
                                    <td class="text-right col-sm-3 col-md-3" colspan="2"><kbd>{{ @dbInformation.info.pass }}</kbd></td>
                                    <td class="text-right col-sm-1 col-md-1">
                                        <check if="{{ strlen(@dbInformation.info.pass) <= 0 }}">
                                            <i class="fas fa-fw fa-exclamation-triangle txt-color txt-color-warning"></i>
                                        </check>
                                    </td>
                                </tr>
                                <tr>
                                    <td>DB status</td>
                                    <td class="text-right col-sm-3 col-md-3" colspan="2">
                                        <check if="{{ @dbInformation.info.connected }}">
                                            <true>
                                                <kbd class="txt-color txt-color-success">
                                                    connected<check if="{{ @dbInformation.info.persistent }}">&nbsp;(persistent)</check>
                                                </kbd>
                                            </true>
                                            <false>
                                                <kbd class="txt-color txt-color-danger">failed</kbd>
                                            </false>
                                        </check>
                                    </td>
                                    <td class="text-right">
                                        <check if="{{ @dbInformation.info.connected }}">
                                            <true>
                                                <i class="fas fa-fw fa-check txt-color txt-color-success"></i>
                                            </true>
                                            <false>
                                                <i class="fas fa-fw fa-exclamation-triangle txt-color txt-color-danger"></i>
                                            </false>
                                        </check>
                                    </td>
                                </tr>
                                {* Connection/PDOExceptions *}
                                <repeat group="{{ @dbInformation.info.errors }}" value="{{ @connectionError }}">
                                    <tr>
                                        <td colspan="3" class="text-center txt-color txt-color-danger">{{ @connectionError }}</td>
                                        <td class="text-right"></td>
                                    </tr>
                                </repeat>

                                <check if="{{ @dbInformation.info.dbConfig }}">
                                    <tr>
                                        <td data-target=".{{ @dbInformation.info.name }}_dbConfig_col" data-toggle="collapse">
                                            <i class="fas fa-fw fa-chevron-right pf-animate-rotate"></i>
                                        </td>
                                        <td class="col-sm-3 col-md-3 text-right">required</td>
                                        <td class="col-sm-3 col-md-3 text-right">installed</td>
                                        <td class="col-sm-1 col-md-1 text-right"></td>
                                    </tr>
                                    <repeat group="{{ @dbInformation.info.dbConfig.data }}" value="{{ @setting }}">
                                        <tr class="{{ @dbInformation.info.name }}_dbConfig_col {{ @dbInformation.info.dbConfig.meta.check ? 'collapse' : '' }}">
                                            <td class="bg-color bg-color-tealDarker">{{ @setting.label }}</td>
                                            <td class="text-right bg-color bg-color-tealDarker">
                                                <check if="{{ @setting.required }}">
                                                    <kbd>{{ @setting.required }}</kbd>
                                                </check>
                                            </td>
                                            <td class="text-right bg-color bg-color-tealDarker">
                                                <check if="{{ @setting.check }}">
                                                    <true>
                                                        <kbd class="txt-color txt-color-success">{{ @setting.version }}</kbd>
                                                    </true>
                                                    <false>
                                                        <kbd class="txt-color txt-color-warning">{{ @setting.version }}</kbd>
                                                    </false>
                                                </check>
                                            </td>
                                            <td class="text-right bg-color bg-color-tealDarker">
                                                <check if="{{ @setting.check }}">
                                                    <true>
                                                        <i class="fas fa-fw fa-check txt-color txt-color-success"></i>
                                                    </true>
                                                    <false>
                                                        <i class="fas fa-fw fa-exclamation-triangle txt-color txt-color-warning"></i>
                                                        <set dbStatusCheck="DB warning" />
                                                    </false>
                                                </check>
                                            </td>
                                        </tr>
                                    </repeat>
                                </check>

                                </tbody>
                            </table>

                            <div class="panel-footer text-align-center">
                                <check if="{{ @dbConnectionStatus == 'OK' }}">
                                    <true>
                                        <check if="{{ @dbStatusCheck == 'OK' }}">
                                            <true>
                                                <h3 class="panel-title txt-color txt-color-success">{{ @dbConnectionStatus }}</h3>
                                            </true>
                                            <false>
                                                <h3 class="panel-title txt-color txt-color-warning">{{ @dbStatusCheck }}</h3>
                                            </false>
                                        </check>
                                    </true>
                                    <false>
                                        <h3 class="panel-title txt-color txt-color-danger">{{ @dbConnectionStatus }}</h3>
                                    </false>
                                </check>
                            </div>

                            <check if="{{ @dbInformation.info.tableData }}">
                                <table class="table">
                                    <thead>
                                    <tr>
                                        <th class="text-center col-sm-1 col-md-1">
                                            <i class="fas fa-fw fa-hashtag"></i>
                                        </th>
                                        <th>Table</th>
                                        <th class="col-sm-1 col-md-1 text-center">exist</th>
                                        <th class="col-sm-3 col-md-3">charset</th>
                                        <th class="col-sm-1 col-md-1 text-center">
                                            <i class="fas fa-fw fa-battery-half"></i>
                                        </th>
                                        <th class="col-sm-1 col-md-1"></th>
                                        <th class="col-sm-1 col-md-1"></th>
                                        <th class="col-sm-1 col-md-1"></th>
                                    </tr>
                                    </thead>
                                    <tbody>

                                    {* Show Tables *}
                                    <repeat group="{{ @dbInformation.info.tableData }}" key="{{ @tableName }}" value="{{ @tableData }}" counter="{{ @countTable }}">
                                        <tr>
                                            <check if="{{ @tableData.fieldConf }}">
                                                <true>
                                                    <td class="text-center" data-target=".{{ @dbInformation.info.name }}_{{ @tableName }}_col" data-toggle="collapse" aria-expanded="false" aria-controls="{{ @dbInformation.info.name }}_{{ @tableName }}_col">
                                                        <i class="fas fa-fw fa-chevron-right pf-animate-rotate"></i>
                                                    </td>
                                                </true>
                                                <false>
                                                    <td class="text-right">{{ @countTable }}.</td>
                                                </false>
                                            </check>

                                            <td>{{ @tableName }}</td>
                                            <td class="text-center">
                                                <check if="{{ @tableData.exists }}">
                                                    <true>
                                                        <i class="fas fa-fw fa-check txt-color txt-color-success"></i>
                                                    </true>
                                                    <false>
                                                        <i class="fas fa-fw fa-ban txt-color txt-color-danger" title="table missing"></i>
                                                    </false>
                                                </check>
                                            </td>
                                            <td>
                                                <check if="{{ @tableData.exists }}">
                                                    <true>
                                                        <check if="{{ @tableData.currentCharset == @tableData.requiredCharset }}">
                                                            <true>
                                                                <kbd class="txt-color txt-color-success" title="{{ @tableData.currentCollation }}">{{ @tableData.currentCharset }}</kbd>
                                                            </true>
                                                            <false>
                                                                <kbd class="txt-color txt-color-warning" title="{{ @tableData.requiredCollation }}">{{ @tableData.requiredCharset }}</kbd>
                                                            </false>
                                                        </check>
                                                    </true>
                                                    <false>
                                                        <i class="fas fa-fw fa-ellipsis-h txt-color txt-color-danger" title="{{ @tableData.requiredCharset }}"></i>
                                                    </false>
                                                </check>
                                            </td>
                                            <td class="text-center">
                                                <check if="{{ @tableData.rows <= 0 }}">
                                                    <true>
                                                        <i class="fas fa-fw fa-battery-empty txt-color txt-color-warning" title="table empty"></i>
                                                    </true>
                                                    <false>
                                                        <i class="fas fa-fw fa-battery-full" title="{{ @tableData.rows }} rows"></i>
                                                    </false>
                                                </check>
                                            </td>
                                            <td></td>
                                            <td></td>
                                            <td class="text-right">
                                                <check if="{{ @tableData.statusCheckCount == 0 && @tableData.exists }}">
                                                    <true>
                                                        <i class="fas fa-fw fa-check txt-color txt-color-success"></i>
                                                    </true>
                                                    <false>
                                                        <i class="fas fa-fw fa-exclamation-triangle txt-color txt-color-warning"></i>
                                                    </false>
                                                </check>
                                            </td>
                                        </tr>

                                        {* Show Columns *}
                                        <check if="{{ @tableData.fieldConf }}">
                                            <tr class="{{ @dbInformation.info.name }}_{{ @tableName }}_col collapse">
                                                <td class="text-right bg-color bg-color-tealDarkest">
                                                    <i class="fas fa-fw fa-hashtag"></i>
                                                </td>
                                                <td class="bg-color bg-color-tealDarkest">column</td>
                                                <td class="bg-color bg-color-tealDarkest text-center">exist</td>
                                                <td class="bg-color bg-color-tealDarkest" title="data type" data-container="body">type</td>
                                                <td class="bg-color bg-color-tealDarkest text-center" title="nullable" data-container="body">null</td>
                                                <td class="bg-color bg-color-tealDarkest text-center" title="index" data-container="body">I</td>
                                                <td class="bg-color bg-color-tealDarkest text-center" title="unique" data-container="body">U</td>
                                                <td class="bg-color bg-color-tealDarkest text-center"></td>
                                            </tr>
                                            <repeat group="{{ @tableData.fieldConf }}" key="{{ @columnName }}" value="{{ @columnData }}" counter="{{ @countCol }}">
                                                <check if="{{ @columnData.type }}">
                                                    {* Required colums *}
                                                    <tr class="{{ @dbInformation.info.name }}_{{ @tableName }}_col collapse">
                                                        <td class="text-right bg-color bg-color-tealDarker">{{@countCol}}.</td>
                                                        <td class="bg-color bg-color-tealDarker">{{ @columnName }}</td>
                                                        <td class="bg-color bg-color-tealDarker text-center">
                                                            <check if="{{ @columnData.exists }}">
                                                                <true>
                                                                    <i class="fas fa-fw fa-check txt-color txt-color-success"></i>
                                                                </true>
                                                                <false>
                                                                    <i class="fas fa-fw fa-ban txt-color txt-color-danger" title="column missing"></i>
                                                                </false>
                                                            </check>
                                                        </td>
                                                        <td class="bg-color bg-color-tealDarker">
                                                            <check if="{{ @columnData.exists }}">
                                                                <true>
                                                                    <check if="{{ @columnData.changedType }}">
                                                                        <true>
                                                                            <kbd class="txt-color txt-color-warning" title="{{ @columnData.requiredType }}">{{ @columnData.currentType }}</kbd>
                                                                        </true>
                                                                        <false>
                                                                            <kbd class="txt-color txt-color-success">{{ @columnData.currentType }}</kbd>
                                                                        </false>
                                                                    </check>
                                                                </true>
                                                                <false>
                                                                    <i class="fas fa-fw fa-ellipsis-h txt-color txt-color-danger" title="{{ @columnData.requiredType }}"></i>
                                                                </false>
                                                            </check>
                                                        </td>
                                                        <td class="bg-color bg-color-tealDarker text-center">
                                                            <check if="{{ @columnData.exists }}">
                                                                <true>
                                                                    <check if="{{ @columnData.changedNullable }}">
                                                                        <true>
                                                                            <kbd class="txt-color txt-color-warning" title="{{ @columnData.requiredNullable }}">{{ @columnData.currentNullable }}</kbd>
                                                                        </true>
                                                                        <false>
                                                                            <kbd class="txt-color txt-color-success">{{ @columnData.currentNullable }}</kbd>
                                                                        </false>
                                                                    </check>
                                                                </true>
                                                                <false>
                                                                    <i class="fas fa-fw fa-ellipsis-h txt-color txt-color-danger" title="{{ @columnData.requiredNullable }}"></i>
                                                                </false>
                                                            </check>
                                                        </td>
                                                        <td class="bg-color bg-color-tealDarker text-center">
                                                            <check if="{{ @columnData.exists }}">
                                                                <true>
                                                                    <check if="{{ @columnData.changedIndex }}">
                                                                        <true>
                                                                            <kbd class="txt-color txt-color-warning" title="{{ @columnData.requiredIndex }}">{{ @columnData.currentIndex }}</kbd>
                                                                        </true>
                                                                        <false>
                                                                            <kbd class="txt-color txt-color-success">{{ @columnData.currentIndex }}</kbd>
                                                                        </false>
                                                                    </check>
                                                                </true>
                                                                <false>
                                                                    <i class="fas fa-fw fa-ellipsis-h txt-color txt-color-danger" title="{{ @columnData.requiredIndex }}"></i>
                                                                </false>
                                                            </check>
                                                        </td>
                                                        <td class="bg-color bg-color-tealDarker text-center">
                                                            <check if="{{ @columnData.exists }}">
                                                                <true>
                                                                    <check if="{{ @columnData.changedUnique }}">
                                                                        <true>
                                                                            <kbd class="txt-color txt-color-warning" title="{{ @columnData.requiredUnique }}">{{ @columnData.currentUnique }}</kbd>
                                                                        </true>
                                                                        <false>
                                                                            <kbd class="txt-color txt-color-success">{{ @columnData.currentUnique }}</kbd>
                                                                        </false>
                                                                    </check>
                                                                </true>
                                                                <false>
                                                                    <i class="fas fa-fw fa-ellipsis-h txt-color txt-color-danger" title="{{ @columnData.requiredUnique }}"></i>
                                                                </false>
                                                            </check>
                                                        </td>
                                                        <td class="bg-color bg-color-tealDarker text-right">
                                                            <check if="{{ @columnData.statusCheck }}">
                                                                <true>
                                                                    <i class="fas fa-fw fa-check txt-color txt-color-success"></i>
                                                                </true>
                                                                <false>
                                                                    <i class="fas fa-fw fa-exclamation-triangle txt-color txt-color-warning"></i>
                                                                </false>
                                                            </check>
                                                        </td>
                                                    </tr>
                                                </check>
                                                <check if="{{ @columnData.deprecated }}">
                                                    {* Deprecated colums *}
                                                    <tr class="{{ @dbInformation.info.name }}_{{ @tableName }}_col collapse txt-color txt-color-yellowDark">
                                                        <td class="bg-color bg-color-tealDarker"></td>
                                                        <td class="bg-color bg-color-tealDarker">{{ @columnName }}</td>
                                                        <td class="bg-color bg-color-tealDarker text-center">
                                                            <i class="fas fa-fw fa-bolt"></i>
                                                        </td>
                                                        <td class="bg-color bg-color-tealDarker">
                                                            <kbd class="txt-color txt-color-yellowDark">{{ @columnData.currentType }}</kbd>
                                                        </td>
                                                        <td class="bg-color bg-color-tealDarker"></td>
                                                        <td class="bg-color bg-color-tealDarker"></td>
                                                        <td class="bg-color bg-color-tealDarker"></td>
                                                        <td class="bg-color bg-color-tealDarker text-right">
                                                            <i class="fas fa-fw fa-exclamation-triangle"></i>
                                                        </td>
                                                    </tr>
                                                </check>
                                            </repeat>
                                        </check>

                                        {* Show Foreign Keys *}
                                        <check if="{{ @tableData.foreignKeys }}">
                                            <tr class="{{ @dbInformation.info.name }}_{{ @tableName }}_col collapse">
                                                <td class="text-right bg-color bg-color-tealDarkest">
                                                    <i class="fas fa-fw fa-hashtag"></i>
                                                </td>
                                                <td class="bg-color bg-color-tealDarkest">foreign key</td>
                                                <td class="bg-color bg-color-tealDarkest"></td>
                                                <td class="bg-color bg-color-tealDarkest"></td>
                                                <td class="bg-color bg-color-tealDarkest"></td>
                                                <td class="bg-color bg-color-tealDarkest"></td>
                                                <td class="bg-color bg-color-tealDarkest"></td>
                                                <td class="bg-color bg-color-tealDarkest"></td>
                                            </tr>
                                            <repeat group="{{ @tableData.foreignKeys }}" value="{{ @keyData }}" counter="{{ @countForeignKey }}">
                                                <tr class="{{ @dbInformation.info.name }}_{{ @tableName }}_col collapse">
                                                    <td class="text-right bg-color bg-color-tealDarker">{{@countForeignKey}}.</td>
                                                    <td class="bg-color bg-color-tealDarker" colspan="6">
                                                        <check if="{{ @keyData.exists }}">
                                                            <true>
                                                                <kbd class="txt-color txt-color-success">{{ @keyData.keyName }}</kbd>
                                                            </true>
                                                            <false>
                                                                <kbd class="txt-color txt-color-danger" title="Foreign key not found">{{ @keyData.keyName }}</kbd>
                                                            </false>
                                                        </check>
                                                    </td>
                                                    <td class="bg-color bg-color-tealDarker text-right">
                                                        <check if="{{ @keyData.exists }}">
                                                            <true>
                                                                <i class="fas fa-fw fa-check txt-color txt-color-success"></i>
                                                            </true>
                                                            <false>
                                                                <i class="fas fa-fw fa-ban txt-color txt-color-danger" title="Foreign key not found"></i>
                                                            </false>
                                                        </check>
                                                    </td>
                                                </tr>
                                            </repeat>
                                        </check>

                                    </repeat>
                                    </tbody>
                                </table>
                            </check>
                        </div>

                        <check if="{{ @dbConnectionStatus == 'OK'}}">
                            <div class="panel-footer text-align-center">
                                <check if="{{ @dbInformation.info.statusCheckCount > 0 }}">
                                    <true>
                                        <h3 class="panel-title txt-color txt-color-warning">{{ @dbInformation.info.statusCheckCount }} warning</h3>
                                        {{ @tplCounter('add', 'database_warning', @dbInformation.info.statusCheckCount) }}
                                        {{ @tplCounter('add', 'database_warning_all', @dbInformation.info.statusCheckCount) }}
                                    </true>
                                    <false>
                                        <h3 class="panel-title txt-color txt-color-success">{{ @dbConnectionStatus }}</h3>
                                    </false>
                                </check>
                            </div>
                        </check>

                        {* DB queries for manual column fixes *}
                        <check if="{{ @dbConnectionStatus == 'OK' && @dbInformation.info.columnQueries }}">
                            <div class="panel-body no-padding">
                                <table class="table">
                                    <thead>
                                    <tr>
                                        <th class="text-center col-sm-1 col-md-1">
                                            <i class="fas fa-fw fa-hashtag"></i>
                                        </th>
                                        <th>query</th>
                                    </tr>
                                    </thead>
                                    <tbody>

                                    <repeat group="{{ @dbInformation.info.columnQueries }}" value="{{ @columnQuery }}" counter="{{ @countQuery }}">
                                        <tr>
                                            <td class="text-right col-sm-1 col-md-1">{{ @countQuery }}.</td>
                                            <td>{{ @columnQuery }}</td>
                                        </tr>
                                    </repeat>
                                    </tbody>
                                </table>
                            </div>
                        </check>

                        <div class="panel-footer btn-group btn-group-justified">
                            <check if="{{ @dbInformation.info.dbCreate }}">
                                <true>
                                    <a href="?action=createDB&db={{ @dbKey }}#pf-setup-database" class="btn btn-success {{ true ?'':'disabled' }}" title="Try to create new '{{ @dbInformation.info.name }}' database." data-container="body">
                                        <i class="fas fa-fw fa-plus"></i> Create database
                                    </a>
                                </true>
                                <false>
                                    <a href="?action=bootstrapDB&db={{ @dbKey }}#pf-setup-database" class="btn btn-primary {{ (@dbInformation.info.setupEnable && @dbConnectionStatus == 'OK') ?'':'disabled' }}">
                                        <i class="fas fa-fw fa-sync"></i> Setup tables
                                    </a>
                                    <a href="?action=fixCols#pf-setup-database" class="btn btn-default {{ @dbInformation.info.columnQueries ?'':'disabled' }}">
                                        <i class="fas fa-fw fa-magic"></i> Fix columns/keys
                                    </a>
                                </false>
                            </check>
                        </div>

                    </div>
                </div>

            </repeat>

        </div>

        <h4 data-target=".pf-setup-body-database" data-toggle="collapse"><i class="fas fa-fw fa-database"></i> Database
            <div class="pull-right">
                <span class="badge badge-warning" title="warning" data-placement="top">{{ @tplCounter('get', 'database' . '_warning') }}</span>
                <span class="badge badge-danger" title="error" data-placement="top">{{ @tplCounter('get', 'database' . '_danger') }}</span>
            </div>
        </h4>
    </div>
</section>

<section id="pf-setup-cache">
    <div class="container row--reverse">
        <div class="row text-center pf-setup-body-cache collapse in">
            <check if="{{ @checkRedisInformation }}">
                <true>
                    {* Redis server found *}
                    <repeat group="{{ @checkRedisInformation }}" value="{{ @redisInformation }}" counter="{{ @countRedisServer }}">

                        <div class="col-xs-12 col-md-6 pf-landing-pricing-panel">
                            <div class="panel panel-default pricing-big">
                                <div class="panel-heading text-left">
                                    <h3 class="panel-title">Redis server No.{{ @countRedisServer }}</h3>
                                </div>

                                <div class="panel-body no-padding text-left">
                                    <table class="table">
                                        <thead>
                                        <tr>
                                            <td>{{ @redisInformation.dsn.label }}</td>
                                            <td class="text-right col-sm-6 col-md-3" colspan="2"><kbd>{{ @redisInformation.dsn.value }}</kbd></td>
                                            <td class="text-right col-sm-1 col-md-1"></td>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr>
                                            <td>{{ @redisInformation.connected.label }}</td>
                                            <td class="text-right col-sm-6 col-md-3" colspan="2">
                                                <check if="{{ @redisInformation.connected.value }}">
                                                    <true>
                                                        <kbd class="txt-color txt-color-success">connected</kbd>
                                                    </true>
                                                    <false>
                                                        <kbd class="txt-color txt-color-danger">failed</kbd>
                                                    </false>
                                                </check>
                                            </td>
                                            <td class="text-right col-sm-1 col-md-1">
                                                <check if="{{ @redisInformation.connected.value }}">
                                                    <true>
                                                        <i class="fas fa-fw fa-check txt-color txt-color-success"></i>
                                                    </true>
                                                    <false>
                                                        <i class="fas fa-fw fa-exclamation-triangle txt-color txt-color-danger"></i>
                                                        {{ @tplCounter('increment', 'cache_danger') }}
                                                    </false>
                                                </check>
                                            </td>
                                        </tr>
                                        <repeat group="{{ @redisInformation.errors }}"  value="{{ @redisError }}">
                                            <tr>
                                                <td colspan="2">{{ @redisError.label | raw}}: {{ @redisError.error }}</td>
                                                <td class="text-right"><kbd class="txt-color txt-color-danger">error</kbd></td>
                                                <td class="text-right"><i class="fas fa-fw fa-exclamation-triangle txt-color txt-color-danger"></i></td>
                                            </tr>
                                            {{ @tplCounter('increment', 'cache_danger') }}
                                        </repeat>
                                        <tr>
                                            <td style="padding: 0"></td>
                                            <td style="padding: 0"></td>
                                            <td style="padding: 0"></td>
                                            <td style="padding: 0"></td>
                                        </tr>
                                        </tbody>
                                    </table>

                                    <check if="{{ @redisInformation.status }}">
                                        <set requirementsData="{{ @redisInformation.status }}" />
                                        <include href="templates/modules/requirements_table.html"/>
                                    </check>
                                </div>

                                {{ @tplCounter('add', 'cache_warning', @tplCounter('get')) }}
                                {{ @tplCounter('reset') }}

                                <div class="panel-footer text-align-center">
                                    <check if="{{ !@tplCounter('get', 'cache_danger') }}">
                                        <true>
                                            <h3 class="panel-title txt-color txt-color-success">OK</h3>
                                        </true>
                                        <false>
                                            <h3 class="panel-title txt-color txt-color-danger">Connection failed</h3>
                                        </false>
                                    </check>
                                </div>
                            </div>
                        </div>

                    </repeat>
                </true>
                <false>
                    {* No Redis server *}
                    <div class="col-xs-12 col-md-6 pf-landing-pricing-panel">
                        <div class="panel panel-default pricing-big" style="position: relative">
                            <div class="panel-heading text-left">
                                <h3 class="panel-title">Redis server</h3>
                            </div>

                            <div class="panel-body no-padding text-left">
                                <table class="table">
                                    <thead>
                                        <tr>
                                            <td>
                                                <i class="fas fa-fw fa-exclamation txt-color txt-color-info"></i>
                                                Redis can be used as Cache backend
                                            </td>
                                            <td class="text-right"><kbd>pathfinder.ini</kbd></td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <i class="fas fa-fw fa-exclamation txt-color txt-color-info"></i>
                                                Redis can be used as PHP Sessions handler
                                            </td>
                                            <td class="text-right"><kbd>php.ini</kbd></td>
                                        </tr>
                                    </thead>
                                </table>
                            </div>

                            <div class="panel-footer text-align-center">
                                <h3 class="panel-title txt-color txt-color-warning">No Redis configuration found</h3>
                            </div>
                        </div>
                    </div>
                </false>
            </check>

        </div>

        <h4 data-target=".pf-setup-body-cache" data-toggle="collapse"><i class="fas fa-fw fa-hdd"></i> Cache <span class="txt-color txt-color-gray">[optional]</span>
            <div class="pull-right">
                <span class="badge badge-warning" title="warning" data-placement="top">{{ @tplCounter('get', 'cache' . '_warning') }}</span>
                <span class="badge badge-danger" title="error" data-placement="top">{{ @tplCounter('get', 'cache' . '_danger') }}</span>
            </div>
        </h4>
    </div>
</section>

<section id="pf-setup-socket">
    <div class="container row--reverse">
        <div class="row text-center pf-setup-body-socket collapse in">

            <repeat group="{{ @socketInformation }}" key="{{ @socketType }}" value="{{ @socketData }}">
                <div class="col-xs-12 col-md-6 pf-landing-pricing-panel">
                    <div id="pf-setup-{{ @socketType }}" data-token="{{ @socketData.token }}" class="panel panel-default pricing-big" style="position: relative">
                        <div class="panel-heading text-left">
                            <h3 class="panel-title"><i class="fas {{ @socketData.icon }}"></i>&nbsp;&nbsp;{{ @socketData.label }}
                                <check if="{{ @socketData.stats }}">
                                    <span class="pull-right">
                                        <kbd title="current active connections">{{ @socketData.stats.connections }} con</kbd>&nbsp;&nbsp;&nbsp;
                                        <kbd title="max active connections since startup">{{ @socketData.stats.maxConnections }} con max</kbd>
                                    </span>
                                </check>
                            </h3>
                        </div>

                        <div class="panel-body no-padding text-left">
                            <table class="table">
                                <thead>
                                    <repeat group="{{ @socketData.data }}" value="{{ @entry }}">
                                        <tr>
                                            <td>{{ @entry.label }}</td>
                                            <td class="text-right col-md-8">
                                                <check if="{{ @entry.check !== false }}">
                                                    <true>
                                                        <kbd>{{@entry.value | raw}}</kbd>
                                                    </true>
                                                    <false>
                                                        <kbd class="txt-color txt-color-danger">{{@entry.value | raw}}</kbd>
                                                    </false>
                                                </check>
                                            </td>
                                            <td class="text-right col-md-1">
                                                <check if="{{ @entry.check }}">
                                                    <true>
                                                        <i class="fas fa-fw fa-check txt-color txt-color-success"></i>
                                                    </true>
                                                    <false>
                                                        <i class="fas fa-fw fa-exclamation-triangle txt-color txt-color-warning"></i>
                                                        {{ @tplCounter('increment', 'socket_warning') }}
                                                    </false>
                                                </check>
                                            </td>
                                        </tr>
                                    </repeat>
                                </thead>
                            </table>
                        </div>

                        <div class="panel-footer text-align-center">
                            <h3 class="panel-title txt-color {{ @socketData.status.class }}">{{ @socketData.status.label }}</h3>
                            <check if="{{ @socketData.status.type == 'danger' }}">
                                {{ @tplCounter('increment', 'socket_danger') }}
                            </check>
                        </div>

                        {* show log data from "stats" array *}
                        <check if="{{ @socketData.stats.logs }}">
                            <div class="panel-body no-padding text-left">
                                <table class="table">
                                    <thead>
                                    <tr>
                                        <td class="col-xs-1" data-target=".{{ @socketType }}_log_col" data-toggle="collapse">
                                            <i class="fas fa-fw fa-chevron-right pf-animate-rotate"></i>
                                        </td>
                                        <td>client URI</td>
                                        <td class="col-xs-2">file #line</td>
                                        <td>message</td>
                                        <td class="col-md-1 text-right">type</td>
                                    </tr>
                                    </thead>
                                    <tbody>

                                    <set logsCheck = 'OK' />
                                    <repeat group="{{ @socketData.stats.logs }}" value="{{ @logData }}">
                                        <set logTypeClass = "" />
                                        <check if="{{ in_array('info', @logData.logTypes) }}">
                                            <set logTypeClass = "txt-color-info" />
                                        </check>
                                        <check if="{{ in_array('error', @logData.logTypes) }}">
                                            <set logTypeClass = "txt-color-warning" />
                                            <set logsCheck = 'ERROR' />
                                        </check>

                                        <tr class="{{ @socketType }}_log_col {{ @logsCheck == 'OK' ? 'collapse' : '' }}">
                                            <td class="bg-color bg-color-tealDarker" title="{{ @logData.mTimeFormat1 }}" data-container="body">
                                                {{ @logData.mTimeFormat2 }}
                                            </td>
                                            <td class="bg-color bg-color-tealDarker" title="{{ @logData.remoteAddress }}" data-container="body">
                                                <set cellValue = "{{ parse_url(@logData.remoteAddress, PHP_URL_HOST) . parse_url(@logData.remoteAddress, PHP_URL_PATH) }}" />
                                                <check if="{{ parse_url(@logData.remoteAddress, PHP_URL_PORT) }}">
                                                    <set cellValue = "{{ @cellValue . ':' . parse_url(@logData.remoteAddress, PHP_URL_PORT) }}" />
                                                </check>

                                                <check if="{{ @logData.resourceId }}">
                                                    <set cellValue = "{{ @cellValue . '&nbsp;#' . @logData.resourceId }}" />
                                                </check>

                                                <check if="{{ @cellValue }}">
                                                    <true>
                                                        <kbd>{{ @cellValue}}</kbd>
                                                    </true>
                                                    <false>
                                                        <check if="{{ @logData.action != 'START' }}">
                                                            <kbd title="send to multiple clients" class="txt-color txt-color-success">broadcast</kbd>
                                                        </check>
                                                    </false>
                                                </check>
                                            </td>
                                            <td class="bg-color bg-color-tealDarker" title="{{ @logData.fileName }} #{{ @logData.lineNumber }}" data-container="body">
                                                <kbd>{{ mb_strimwidth(pathinfo(@logData.fileName, PATHINFO_FILENAME), 0, 15, '…') }}</kbd>
                                            </td>
                                            <td class="bg-color bg-color-tealDarker">{{ @logData.message }}</td>
                                            <td class="text-right bg-color bg-color-tealDarker" title="{{ implode(', ', @logData.logTypes) }}" data-placement="right" data-container="body">
                                                <i class="fas fa-fw fa-tag txt-color {{ @logTypeClass }}"></i>
                                            </td>
                                        </tr>
                                    </repeat>
                                    </tbody>
                                </table>
                            </div>
                        </check>

                    </div>
                </div>
            </repeat>

        </div>

        <h4 data-target=".pf-setup-body-socket" data-toggle="collapse"><i class="fas fa-fw fa-random"></i> Socket configuration <span class="txt-color txt-color-gray">[optional]</span>
            <div class="pull-right">
                <span class="badge badge-warning" title="warning" data-placement="top">{{ @tplCounter('get', 'socket' . '_warning') }}</span>
                <span class="badge badge-danger" title="error" data-placement="top">{{ @tplCounter('get', 'socket' . '_danger') }}</span>
            </div>
        </h4>
    </div>
</section>

<section id="pf-setup-cronjob">
    <div class="container row--reverse">
        <div class="row text-center pf-setup-body-cronjob collapse in">

            <div class="col-xs-12 col-md-6 pf-landing-pricing-panel">
                <div class="panel panel-default pricing-big">

                    <div class="panel-heading text-left">
                        <h3 class="panel-title"><i class="fas fa-user-clock"></i>&nbsp;&nbsp;Configuration <kbd class="pull-right">app/cron.ini</kbd></h3>
                    </div>

                    <div class="panel-body no-padding text-left">
                        <check if="{{ @cronConfig.checkCronConfig }}">
                            <set requirementsData="{{ @cronConfig.checkCronConfig }}" />
                            <include href="templates/modules/requirements_table.html"/>
                        </check>
                    </div>
                </div>
            </div>

            <div class="col-xs-12 pf-landing-pricing-panel">
                <div class="panel panel-default pricing-big">

                    <div class="panel-heading text-left">
                        <h3 class="panel-title"><i class="fas fa-calendar"></i>&nbsp;&nbsp;Jobs</h3>
                    </div>

                    <div class="panel-body no-padding text-left">
                        <table class="table pf-table-fixed">
                            <colgroup>
                                <col style="width: 45px;" class="bg-color bg-color-grayDark"/>
                                <col/>
                                <col class="hidden-xs hidden-sm"/>
                                <col style="width: 120px;"/>
                                <col style="width: 85px;" span="3"/>
                                <col style="width: 75px;" span="2"class="hidden-xs hidden-sm"/>
                                <col style="width: 45px;"/>
                                <col style="width: 85px;"/>
                            </colgroup>
                            <thead>
                                <tr>
                                    <td class="bg-color bg-color-gray"></td>
                                    <td></td>
                                    <td class="hidden-xs hidden-sm"></td>
                                    <td class="separator-right"></td>
                                    <td class="text-center separator-right" colspan="3">last</td>
                                    <td class="text-center hidden-xs hidden-sm separator-right" colspan="2">average</td>
                                    <td></td>
                                    <td class="text-right no-padding">
                                        <div class="btn-group">
                                            <label
                                                class="btn btn-default" data-toggle="button"
                                                data-action="cronTable" data-callback="updateCronjob"
                                                data-payload="{{ htmlspecialchars(json_encode(['count' => 0])) }}"
                                                data-loading-text="<i class='fas fa-fw fa-sync fa-spin'></i>"
                                            >
                                                <i class="fas fa-fw fa-sync"></i>
                                            </label>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="text-right bg-color bg-color-gray">status</td>
                                    <td>name</td>
                                    <td class="hidden-xs hidden-sm">handler</td>
                                    <td class="separator-right">schedule</td>
                                    <td class="text-center">start time</td>
                                    <td class="text-right">exec.&nbsp;time</td>
                                    <td class="text-right separator-right">mem.&nbsp;peak</td>
                                    <td class="text-right hidden-xs hidden-sm">exec.&nbsp;time</td>
                                    <td class="text-right hidden-xs hidden-sm separator-right">mem.&nbsp;peak</td>
                                    <td class="text-center"><i class="fas fa-fw fa-file-alt"></i></td>
                                    <td class="text-right"></td>
                                </tr>
                            </thead>
                            <tbody>
                                <include href="templates/ui/cron_table_row.html"/>
                            </tbody>
                        </table>
                    </div>

                    <div class="panel-footer text-align-center">
                        <h3 class="panel-title txt-color txt-color-danger pf-hidden-by-attr" data-attr="{{ @tplCounter('get', 'cronjob_danger') }}" data-attr-type="danger" data-attr-label="error"></h3>
                        <h3 class="panel-title txt-color txt-color-warning pf-hidden-by-attr" data-attr="{{ @tplCounter('get', 'cronjob_warning') }}" data-attr-type="warning" data-attr-label="warning"></h3>
                        <h3 class="panel-title txt-color txt-color-success pf-shown-by-attr" data-attr="{{ @tplCounter('get', 'cronjob_danger') + @tplCounter('get', 'cronjob_warning') ? : '' }}" data-attr-type="success" data-attr-label="OK"></h3>
                    </div>
                </div>
            </div>

        </div>

        <h4 data-target=".pf-setup-body-cronjob" data-toggle="collapse"><i class="fas fa-fw fa-user-clock"></i> Cronjob
            <div class="pull-right">
                <span class="badge badge-warning" title="warning" data-placement="top">{{ @tplCounter('get', 'cronjob' . '_warning') }}</span>
                <span class="badge badge-danger" title="error" data-placement="top">{{ @tplCounter('get', 'cronjob' . '_danger') }}</span>
            </div>
        </h4>
    </div>
</section>

<section id="pf-setup-administration">
    <div class="container row--reverse">
        <div class="row text-center pf-setup-body-administration collapse in">
            <div class="col-xs-12 col-md-6 pf-landing-pricing-panel">

                {* Index *}
                <div class="panel panel-default pricing-big">

                    <div class="panel-heading text-left">
                        <h3 class="panel-title">
                            <i class="fas fa-cloud-download-alt"></i>&nbsp;&nbsp;Import static data
                            <i class="fas fa-fw fa-sm fa-question-circle pf-help-light"
                               title="Re-importing/update static data from either ESI API and/or /export/*.csv files. Increase 'max_execution_time' if you run into PHP timeouts."
                               data-container="body"
                            ></i>
                        </h3>
                    </div>

                    <div class="panel-body no-padding text-left">
                        <table class="table">
                            <thead>
                                <check if="{{ count( @indexInformation ) > 1 }}">
                                    {* hide table head row if there is just one (error!) table row *}
                                    <tr>
                                        <td></td>
                                        <td class="col-xs-2 col-md-2 text-right">count</td>
                                        <td class="col-xs-2 col-md-2 text-right">sub count</td>
                                        <td class="col-xs-4 col-md-4"></td>
                                    </tr>
                                </check>
                            </thead>
                            <tbody>
                            <repeat group="{{ @indexInformation }}" key="{{ @type }}" value="{{ @indexData }}">
                                <check if="{{ is_numeric( @type ) }}">
                                    <true>
                                        </tbody>
                                            </table>
                                            <div class="panel-footer txt-color {{ @indexData.class }}">
                                                <h3 class="panel-title">
                                                    <check if="{{ @indexData.icon }}">
                                                        <i class="fas {{ @indexData.icon }}"></i>&nbsp;&nbsp;
                                                    </check>
                                                    {{@indexData.label}}
                                                    <check if="{{ @indexData.tooltip }}">
                                                        <i class="fas fa-fw fa-sm fa-question-circle pf-help-light" title="{{ @indexData.tooltip }}" data-container="body"></i>
                                                    </check>
                                                </h3>
                                            </div>
                                            <table class="table">
                                        <tbody>
                                    </true>
                                    <false>
                                        <tr>
                                            <td>{{ @indexData.label }}
                                                <check if="{{ @indexData.tooltip }}">
                                                    <i class="fas fa-fw fa-sm fa-question-circle pf-help-light" title="{{ @indexData.tooltip }}" data-container="body"></i>
                                                </check>
                                            </td>
                                            <td class="col-xs-2 col-md-2 text-right">
                                                <check if="{{ isset(@indexData.countAll) }}">
                                                    <check if="{{ @indexData.countBuild > 0 && @indexData.countBuild  >= @indexData.countAll }}">
                                                        <kbd class="txt-color txt-color-success">{{ @indexData.countBuild }}/{{ @indexData.countAll }}</kbd>
                                                    </check>
                                                    <check if="{{ @indexData.countBuild > 0 && @indexData.countBuild < @indexData.countAll}}">
                                                        <kbd class="txt-color txt-color-warning">{{ @indexData.countBuild }}/{{ @indexData.countAll }}</kbd>
                                                        {{ @tplCounter('increment', 'administration_warning') }}
                                                    </check>
                                                    <check if="{{ @indexData.countBuild <= 0 }}">
                                                        <kbd class="txt-color txt-color-danger">{{ @indexData.countBuild }}/{{ @indexData.countAll }}</kbd>
                                                        {{ @tplCounter('increment', 'administration_danger') }}
                                                    </check>
                                                </check>
                                            </td>
                                            <td class="col-xs-2 col-md-2 text-right">
                                                <check if="{{ @indexData.subCount }}">
                                                    <kbd data-countAll="{{ @indexData.subCount.countAll }}">{{ @indexData.subCount.countBuild }}/{{ @indexData.subCount.countAll }}</kbd>
                                                </check>
                                            </td>
                                            <td class="col-xs-4 col-md-4 no-padding">
                                                <div class="btn-group btn-group-justified">
                                                    <repeat group="{{ @indexData.task }}" key="{{ @taskKey }}" value="{{ @taskData }}">
                                                        <a
                                                            data-action="{{ @taskData.action }}" data-callback="updateIndexCount"
                                                            data-payload="{{ htmlspecialchars(json_encode(['type' => @type, 'countAll' => @indexData.countAll, 'count' => 0, 'offset' => 0])) }}"
                                                            data-loading-text="<i class='fas fa-sync fa-spin'></i>&nbsp;&nbsp;wait&hellip;<div class='btn-progress'></div>" autocomplete="off"
                                                            class="btn {{ @taskData.btn }} {{ @taskData.btn=='btn-default' && !@indexData.countBuild ?'disabled':'' }} {{ @tplCounter('get', 'database_warning_all') ?'disabled':'' }}" role="button"
                                                        >
                                                            <i class="fas fa-fw {{ @taskData.icon }}"></i>&nbsp;{{ @taskData.label }}
                                                        </a>
                                                    </repeat>
                                                </div>
                                            </td>
                                        </tr>
                                    </false>
                                </check>
                            </repeat>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>

            <div class="col-xs-12 col-md-6 pf-landing-pricing-panel">

                {* Filesystem cache *}
                <div class="panel panel-default pricing-big">

                    <div class="panel-heading text-left">
                        <h3 class="panel-title"><i class="fas fa-folder"></i>&nbsp;&nbsp;Filesystem cache
                            <kbd class="pull-right">
                                <check if="{{ @checkDirSize.sizeAll }}">
                                    <true>
                                        {{ @checkDirSize.sizeAll }}
                                    </true>
                                    <false>
                                        0KB
                                    </false>
                                </check>
                            </kbd>
                        </h3>
                    </div>

                    <div class="panel-body no-padding">
                        <table class="table">
                            <thead>
                            <repeat group="{{ @checkDirSize.dirAll }}" key="{{ @key }}" value="{{ @dirData }}">
                                <tr>
                                    <td>{{ @dirData.label }}</td>
                                    <td class="col-xs-3 text-right">
                                        <kbd>{{ @dirData.path }}&nbsp;→
                                            <check if="{{ @dirData.size }}">
                                                <true>
                                                    {{ @dirData.size }}
                                                </true>
                                                <false>
                                                    0KB
                                                </false>
                                            </check>
                                        </kbd>
                                    </td>
                                    <td class="col-xs-6 no-padding">
                                        <div class="btn-group btn-group-justified">
                                            <repeat group="{{ @dirData.task }}"  value="{{ @taskData }}">
                                                <a href="?{{ @taskData.action }}#pf-setup-administration" class="btn {{ @taskData.btn }}" role="button">
                                                    <i class="fas fa-fw {{ @taskData.icon }}"></i>&nbsp;{{ @taskData.label }}
                                                </a>
                                            </repeat>
                                        </div>
                                    </td>
                                </tr>
                            </repeat>
                            </thead>
                        </table>
                    </div>
                </div>
            </div>

            <div class="col-xs-12 col-md-6 pf-landing-pricing-panel">
                {* Cookie *}
                <div class="panel panel-default pricing-big">
                    <div class="panel-heading text-left">
                        <h3 class="panel-title"><i class="fas fa-cookie-bite"></i>&nbsp;&nbsp;Cookies
                            <i class="fas fa-fw fa-sm fa-question-circle pf-help-light" title="Force all users to re-login through SSO. "></i>
                        </h3>
                    </div>

                    <div class="panel-body no-padding">
                        <table class="table">
                            <thead>
                            <tr>
                                <td>Invalidate all Cookie data</td>
                                <td class="col-xs-6 no-padding">
                                    <div class="btn-group btn-group-justified">
                                        <a class="btn btn-danger" href="?action=invalidateCookies#pf-setup-administration" role="button" >
                                            <i class="fas fa-fw fa-trash"></i>&nbsp;Clear authentication data
                                        </a>
                                    </div>
                                </td>
                            </tr>
                            </thead>
                            <tbody>

                            </tbody>
                        </table>
                    </div>
                </div>
            </div>

        </div>

        <h4 data-target=".pf-setup-body-administration" data-toggle="collapse"><i class="fas fa-fw fa-wrench"></i> Administration
            <div class="pull-right">
                <span class="badge badge-warning" title="warning" data-placement="top">{{ @tplCounter('get', 'administration' . '_warning') }}</span>
                <span class="badge badge-danger" title="error" data-placement="top">{{ @tplCounter('get', 'administration' . '_danger') }}</span>
            </div>
        </h4>
    </div>
</section>

{* Top navigation *}
<nav id="pf-navbar" class="navbar navbar-default navbar-fixed-top pf-head">
    <div class="container col-sm-12">
        <div id="pf-head" class="navbar-header">
            <span class="navbar-brand pf-head-menu">
                <svg class="pf-head-menu-logo" width="24px" height="24px">
                    <use xlink:href="#pf-svg-logo"/>
                </svg>
                &nbsp;&nbsp;Setup
            </span>
        </div>
        <div class="navbar-collapse">
            <ul class="nav navbar-nav navbar-right" role="tablist">
                <repeat group="{{ @tplNavigation }}" key="{{ @navKey }}" value="{{ @navConfig }}">
                    <li>
                        <a class="page-scroll" data-target="pf-setup-{{ @navKey }}" href="#pf-setup-{{ @navKey }}"><i class="fas fa-fw {{ @navConfig.icon }}"></i>&nbsp;{{ lcfirst(@navKey) }}
                            <span class="badge txt-color txt-color-warning" title="warning" data-placement="bottom">{{ @tplCounter('get', @navKey . '_warning') }}</span>
                            <span class="badge txt-color txt-color-danger" title="error" data-placement="bottom">{{ @tplCounter('get', @navKey . '_danger') }}</span>
                        </a>
                    </li>
                </repeat>
            </ul>
        </div>
    </div>
</nav>

{* footer *}
<set panel2="{{ [['icon' => 'far fa-window-maximize', 'label' => 'toggle', 'action' => 'collapse-all']] }}" />
<include href="templates/layout/footer_simple.html" with="p2={{ @panel2 }}"/>

{* svg *}
<div class="pf-svg-wrapper">
    <include href="{{ 'img/' . @PATHFINDER.VERSION . '/svg/logo_inline.svg' }}"/>
</div>